﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management.Automation;

using Microsoft.SharePoint.Administration;
using Microsoft.SharePoint.PowerShell;

namespace Mystery.SharePoint.PowerShell
{
    [SPCmdlet(RequireUserFarmAdmin = true)]
    [Cmdlet("Get", "SPMSiteProvisioningSettings")]
    class GetSiteProvisioningSettingsCmdlet : SPGetCmdletBase<SiteProvisioningSettings>
    {
        [Parameter(Mandatory = true, ValueFromPipeline = true)]
        public SPWebApplicationPipeBind WebApplication { get; set; }
 
        protected override IEnumerable<SiteProvisioningSettings> RetrieveDataObjects()
        {
            
            SPWebApplication app = WebApplication.Read();

            base.DataObject = app.GetSiteProvisioningSettings();

            return new SiteProvisioningSettings[] { this.DataObject };
        }
    }
}
